Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hl 970 open ahjo case #2519

Merged
merged 11 commits into from
Dec 7, 2023
Merged

Hl 970 open ahjo case #2519

merged 11 commits into from
Dec 7, 2023

Conversation

rikuke
Copy link
Collaborator

@rikuke rikuke commented Nov 22, 2023

Description ✨

Adds an API_BASE_URL to get absolute url for the api endpoints.
Adds a service applications.services.ahjo_payload with functions to generate the Ahjo request Json payload.
Adds function do_ahjo_request_with_json_payload()to ahjo_integration.py for performing the open case request to Ahjo.
Adds a function open_case_in_ahjo() which handles the sending of the case open request.

Issues 🐛

The various hard-coded string values such as Subject and ClassificationTitle etc. in the Json payload should possibly be localized and/or configured as enums.
The do_ahjo_request_with_form_data() and encode_multipart_formdata() functions are possibly redundant as the Json payload seems to work fine now. Perhaps remove them later, when 100% sure that the Json payload works with all bells and whistles.

Testing ⚗️

Manually testing the request from the shell:
Turn VPN on.
Add ahjo_code to ahjo_settings via the Django admin.
Instructions for configuring the Ahjo authentication can be found here
Run:
python manage.py seed

python manage.py shell_plus

from applications.services.ahjo_integration import open_case_in_ahjo

from applications.enums import ApplicationStatus

application = Application.objects.filter( status=ApplicationStatus.ACCEPTED).prefetch_related("attachments", "calculation", "company").first()

`AhjoStatus.objects.create(application=application, status=AhjoStatusEnum.SUBMITTED_BUT_NOT_SENT_TO_AHJO)

User.objects.filter(id=application.calculation.handler.id).update(ad_username="kissa123")

open_case_in_ahjo(application.id)

Screenshots 📸

Additional notes 🗒️

@rikuke rikuke force-pushed the HL-970-open-ahjo-case branch from 4412dc8 to 37e2e81 Compare November 24, 2023 15:09
@terovirtanen
Copy link
Contributor

API branch is deployed to platta: https://helsinkilisa-pr2519.api.dev.hel.ninja/healthz 🚀🚀🚀

@rikuke rikuke force-pushed the HL-970-open-ahjo-case branch from 37e2e81 to 2bad780 Compare November 24, 2023 15:24
@terovirtanen
Copy link
Contributor

API branch is deployed to platta: https://helsinkilisa-pr2519.api.dev.hel.ninja/healthz 🚀🚀🚀

@terovirtanen
Copy link
Contributor

APPLICANT branch is deployed to platta: https://helsinkilisa-ui-pr2519.dev.hel.ninja 🚀🚀🚀

@terovirtanen
Copy link
Contributor

TestCafe result is success for https://helsinkilisa-ui-pr2519.dev.hel.ninja 😆🎉🎉🎉

@terovirtanen
Copy link
Contributor

HANDLER branch is deployed to platta: https://helsinkilisa-ui-handler-pr2519.dev.hel.ninja 🚀🚀🚀

@terovirtanen
Copy link
Contributor

TestCafe result is success for https://helsinkilisa-ui-handler-pr2519.dev.hel.ninja 😆🎉🎉🎉

@rikuke rikuke force-pushed the HL-970-open-ahjo-case branch from 2bad780 to 1859a89 Compare November 27, 2023 13:49
@terovirtanen
Copy link
Contributor

API branch is deployed to platta: https://helsinkilisa-pr2519.api.dev.hel.ninja/healthz 🚀🚀🚀

@terovirtanen
Copy link
Contributor

APPLICANT branch is deployed to platta: https://helsinkilisa-ui-pr2519.dev.hel.ninja 🚀🚀🚀

@terovirtanen
Copy link
Contributor

TestCafe result is success for https://helsinkilisa-ui-pr2519.dev.hel.ninja 😆🎉🎉🎉

@terovirtanen
Copy link
Contributor

HANDLER branch is deployed to platta: https://helsinkilisa-ui-handler-pr2519.dev.hel.ninja 🚀🚀🚀

@terovirtanen
Copy link
Contributor

TestCafe result is success for https://helsinkilisa-ui-handler-pr2519.dev.hel.ninja 😆🎉🎉🎉

@rikuke rikuke force-pushed the HL-970-open-ahjo-case branch from 1859a89 to 4f9966e Compare November 27, 2023 16:13
@terovirtanen
Copy link
Contributor

API branch is deployed to platta: https://helsinkilisa-pr2519.api.dev.hel.ninja/healthz 🚀🚀🚀

@terovirtanen
Copy link
Contributor

APPLICANT branch is deployed to platta: https://helsinkilisa-ui-pr2519.dev.hel.ninja 🚀🚀🚀

@terovirtanen
Copy link
Contributor

TestCafe result is success for https://helsinkilisa-ui-pr2519.dev.hel.ninja 😆🎉🎉🎉

@terovirtanen
Copy link
Contributor

HANDLER branch is deployed to platta: https://helsinkilisa-ui-handler-pr2519.dev.hel.ninja 🚀🚀🚀

@terovirtanen
Copy link
Contributor

TestCafe result is success for https://helsinkilisa-ui-handler-pr2519.dev.hel.ninja 😆🎉🎉🎉

@terovirtanen
Copy link
Contributor

API branch is deployed to platta: https://helsinkilisa-pr2519.api.dev.hel.ninja/healthz 🚀🚀🚀

@rikuke rikuke force-pushed the HL-970-open-ahjo-case branch from e93a2d3 to ca33899 Compare November 29, 2023 08:09
@rikuke rikuke marked this pull request as ready for review November 29, 2023 08:14
@rikuke rikuke requested review from mjturt and sirtawast November 29, 2023 08:14
@terovirtanen
Copy link
Contributor

API branch is deployed to platta: https://helsinkilisa-pr2519.api.dev.hel.ninja/healthz 🚀🚀🚀

@terovirtanen
Copy link
Contributor

APPLICANT branch is deployed to platta: https://helsinkilisa-ui-pr2519.dev.hel.ninja 🚀🚀🚀

@terovirtanen
Copy link
Contributor

TestCafe result is success for https://helsinkilisa-ui-pr2519.dev.hel.ninja 😆🎉🎉🎉

@terovirtanen
Copy link
Contributor

HANDLER branch is deployed to platta: https://helsinkilisa-ui-handler-pr2519.dev.hel.ninja 🚀🚀🚀

@terovirtanen
Copy link
Contributor

TestCafe result is success for https://helsinkilisa-ui-handler-pr2519.dev.hel.ninja 😆🎉🎉🎉

@rikuke rikuke force-pushed the HL-970-open-ahjo-case branch from 487fb89 to 93e852b Compare December 7, 2023 08:15
@terovirtanen
Copy link
Contributor

API branch is deployed to platta: https://helsinkilisa-pr2519.api.dev.hel.ninja/healthz 🚀🚀🚀

@terovirtanen
Copy link
Contributor

APPLICANT branch is deployed to platta: https://helsinkilisa-ui-pr2519.dev.hel.ninja 🚀🚀🚀

@terovirtanen
Copy link
Contributor

TestCafe result is success for https://helsinkilisa-ui-pr2519.dev.hel.ninja 😆🎉🎉🎉

Copy link

sonarqubecloud bot commented Dec 7, 2023

[yjdh] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link

sonarqubecloud bot commented Dec 7, 2023

[yjdh] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 5 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link

sonarqubecloud bot commented Dec 7, 2023

[yjdh] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 5 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link

sonarqubecloud bot commented Dec 7, 2023

[yjdh] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 9 Code Smells

85.0% 85.0% Coverage
0.0% 0.0% Duplication

@terovirtanen
Copy link
Contributor

API branch is deployed to platta: https://helsinkilisa-pr2519.api.dev.hel.ninja/healthz 🚀🚀🚀

@terovirtanen
Copy link
Contributor

APPLICANT branch is deployed to platta: https://helsinkilisa-ui-pr2519.dev.hel.ninja 🚀🚀🚀

@terovirtanen
Copy link
Contributor

TestCafe result is success for https://helsinkilisa-ui-pr2519.dev.hel.ninja 😆🎉🎉🎉

@terovirtanen
Copy link
Contributor

HANDLER branch is deployed to platta: https://helsinkilisa-ui-handler-pr2519.dev.hel.ninja 🚀🚀🚀

@terovirtanen
Copy link
Contributor

TestCafe result is success for https://helsinkilisa-ui-handler-pr2519.dev.hel.ninja 😆🎉🎉🎉

@mjturt mjturt self-requested a review December 7, 2023 13:18
@rikuke rikuke merged commit faa899c into main Dec 7, 2023
65 checks passed
@rikuke rikuke deleted the HL-970-open-ahjo-case branch December 7, 2023 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants